package jsu.yym.tiktok.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import jsu.yym.tiktok.pojo.Fans;
import jsu.yym.tiktok.pojo.Like;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.data.repository.query.Param;

import java.util.List;

@Mapper
public interface FansMapper extends BaseMapper<Fans> {
    @Select("select person_id from fans where username = #{username}")
    List<String> getPersonIdsByUsername(String username);

    @Insert("INSERT INTO fans (username, person_id) VALUES (#{username}, #{person_id})")
    void insertFans(Fans fans);
    @Select("select username from fans where person_id = #{person_id}")
    List<String> getFansByUsername(String person_id);
}
